#ifdef __AVR__
#include <inttypes.h>
#endif

void init_hw();

void set_alive_led(uint8_t state);
void set_error_led(uint8_t state);
void set_exec_led(uint8_t state);

void readInputs();
void writeOutputs();
uint16_t getAnalogInputValue_16b(uint8_t idx);
void setAnalogOutputValue_16b(uint8_t idx, uint16_t value);

int8_t check_output_port(uint8_t port);
int8_t check_input_port(uint8_t port);

void Enable_interrupt();
void Disable_interrupt();

uint8_t getInputPortD();
uint8_t getInputPortC();
uint8_t getInputPortA();

#define KEY_UP		0x04
#define KEY_DOWN	0x10
#define KEY_LEFT	0x08
#define KEY_RIGHT	0x20
#define KEY_OK		0x80
